{#{% extends "cmdb/include/page_temp.html" %}#}
{% extends "layout/index.html" %}

{% load cmdb_asset %}

{% block css %}
    <style>
        .dotted {
            border-top: 1px dotted #ddd;
        }

        .text-left {
            text-align: left !important;
        }
    </style>

    <style>
        .guige {

        }

        .guige-table {
            width: 100%;
            border-collapse: collapse;
            border-spacing: 0;
        }

        .guige-table .title {
            background: #f5fafe;
            text-align: left;
            font-weight: bold;
            line-height: 32px;
            height: 32px;
            font-family: "微软雅黑";
            border-right: 1px solid #dcdcdc;
            border-left: 2px solid #0488cd;
        }

        .guige-table td, .content .guige-table th {
            border: 1px solid #dcdcdc;
            line-height: 30px;
            height: 30px;
            padding: 0 10px;
            border-top: 0;
        }

        .guige-table .body-left {
            width: 126px;
            font-weight: normal;
            text-align: right;
            color: #666;
        }

        .guige-table .body-right {
            color: #333;
        }

    </style>

    <style>
        .handle_log {
            font-size: 13px !important;
            font-family: Tahoma, Geneva, Helvetica, sans-serif !important;
        }

        .time {
            padding: 10px;
            border: 1px solid #ddd;
            position: absolute;
            width: 150px;
            left: -190px;
            box-shadow: 0 2px 8px 2px rgba(0, 0, 0, 0.12);
        }

        .record {
            padding: 10px;
            border: 1px solid #ddd;
            margin: 17px;
            min-height: 40px;
            box-shadow: 0 2px 8px 2px rgba(0, 0, 0, 0.12);
        }

        .record .auther {
            text-align: right;
            padding: 5px 0px;
            color: #9E9C9C;
        }

        .record-arrow {
            position: absolute;
            width: 24px;
            height: 14px;
            background: url(/static/imgs/bg_dot_left3.png) no-repeat;
            top: 15px;
            left: -6px;
            text-indent: -9999em;
        }

        .tag {
            padding: 6px;
            background-color: #00a2ca;
            margin: 10px;
            color: white;
            cursor: pointer;
            border-radius: 10px;
        }

        .add-tag {
            margin: 10px;
            color: #00a2ca;
            cursor: pointer;
            font-size: 16px;
        }
    </style>

{% endblock %}

{% block conent %}
    <div id="page-wrapper">
        <div id="breadcrumb" style="margin-bottom: 0">
            <ul class="breadcrumb">
                    <li>
                        <a href="/cmdb/">首页</a>

                    </li>
                    <li><a href="/cmdb/asset.html">资产管理</a></li>
                    <li class="active">查看资产详情</li>
                </ul>
        </div>

        <div style="padding: 5px 8px;">

            <div>
                <!-- Nav tabs -->
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active"><a class="no-radius" href="#basic" aria-controls="basic" role="tab" data-toggle="tab">基本信息</a></li>
                    <li role="presentation"><a class="no-radius" href="#hardware" aria-controls="hardware" role="tab" data-toggle="tab">硬件信息</a></li>
                    <li role="presentation"><a class="no-radius" href="#log" aria-controls="log" role="tab" data-toggle="tab">变更记录</a></li>

                </ul>

                <!-- Tab panes -->
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="basic">

                        <div class="form-horizontal clearfix" style="margin-top:20px;">

                            <div class="form-group col-md-6">
                                <div class="col-md-4 control-label">主机名: </div>
                                <div class="col-md-7 control-label text-left">{{ result_data.basic_data.hostname }}</div>
                            </div>

                            <div class="form-group col-md-6">
                                <div class="col-md-4 control-label">管理IP: </div>
                                <div class="col-md-7 control-label text-left">{{ result_data.basic_data.manage_ip }}</div>
                            </div>

                            <div class="form-group col-md-6">
                                <div class="col-md-4 control-label">序列号: </div>
                                <div class="col-md-7 control-label text-left">{{ result_data.basic_data.sn }}</div>
                            </div>

                            <div class="form-group col-md-6">
                                <div class="col-md-4 control-label">状态: </div>
                                <div class="col-md-7 control-label text-left">{{ result_data.basic_data.status }}</div>
                            </div>


                            <div class="form-group col-md-6">
                                <div class="col-md-4 control-label">更新时间: </div>
                                <div class="col-md-7 control-label text-left">{{ result_data.basic_data.latest_date }}</div>
                            </div>

                            <div class="dotted  col-md-12"></div>

                            <div class="form-group col-md-6">
                                <div class="col-md-4 control-label">机房: </div>
                                <div class="col-md-7 control-label text-left">{{ result_data.basic_data.idc }}</div>
                            </div>

                            <div class="form-group col-md-6">
                                <div class="col-md-4 control-label">楼层: </div>
                                <div class="col-md-7 control-label text-left">{{ result_data.basic_data.floor }}</div>
                            </div>

                            <div class="form-group col-md-6">
                                <div class="col-md-4 control-label">机柜: </div>
                                <div class="col-md-7 control-label text-left">{{ result_data.basic_data.cabinet_num }}</div>
                            </div>

                            <div class="form-group col-md-6">
                                <div class="col-md-4 control-label">柜上位置: </div>
                                <div class="col-md-7 control-label text-left">{{ result_data.basic_data.cabinet_order }}</div>
                            </div>

                            <div class="dotted col-md-12"></div>

                            <div class="form-group col-md-6">
                                <div class="col-md-4 control-label">业务线: </div>
                                <div class="col-md-7 control-label text-left">{{ result_data.basic_data.business_data.business_unit }}</div>
                            </div>

                            <div class="col-md-12">
                                <div class="form-group col-md-6">
                                    <div class="col-md-4 control-label">业务联系人: </div>
                                    <div class="col-md-8 control-label text-left">
                                        {% for i in result_data.basic_data.business_data.contact_data %}
                                            <div>
                                                <p>{{ i.name }}</p>
                                                <div style="margin-left: 20px;">
                                                    <p>邮箱: {{ i.email }}</p>
                                                    <p>手机: {{ i.mobile }}</p>
                                                    <p>座机: {{ i.phone }}</p>
                                                </div>
                                            </div>
                                        {% endfor %}
                                    </div>
                                </div>
                                <div class="form-group col-md-6">
                                    <div class="col-md-4 control-label">运维联系人: </div>
                                    <div class="col-md-8 control-label text-left">
                                        {% for i in result_data.basic_data.business_data.manager_data %}
                                            <div>
                                                <p>{{ i.name }}</p>
                                                <div style="margin-left: 20px;">
                                                    <p>邮箱: {{ i.email }}</p>
                                                    <p>手机: {{ i.mobile }}</p>
                                                    <p>座机: {{ i.phone }}</p>
                                                </div>
                                            </div>
                                        {% endfor %}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div role="tabpanel" class="tab-pane" id="hardware">


                        <div class="guige">
                            <table class="guige-table">
                                <tbody>

                                    <tr>
                                        <th colspan="5" class="title f14 th"><span class="padding-l-8">基础信息</span></th>
                                    </tr>
                                    <tr>
                                        <td>名称</td>
                                        <td colspan="4">值</td>
                                    </tr>
                                    <tr>
                                        <td>操作系统</td>
                                        <td colspan="4">{{ result_data.hardware_data.base_data.os_platform }}</td>
                                    </tr>
                                    <tr>
                                        <td>系统版本</td>
                                        <td colspan="4">{{ result_data.hardware_data.base_data.os_version }}</td>
                                    </tr>
                                    <tr>
                                        <td>主板序列号</td>
                                        <td colspan="4">{{ result_data.hardware_data.base_data.sn }}</td>
                                    </tr>
                                    <tr>
                                        <td>主板型号</td>
                                        <td colspan="4">{{ result_data.hardware_data.base_data.model }}</td>
                                    </tr>
                                    <tr>
                                        <td>主板厂商</td>
                                        <td colspan="4">{{ result_data.hardware_data.base_data.manufacturer }}</td>
                                    </tr>
                                    <tr>
                                        <td>CPU逻辑核数</td>
                                        <td colspan="4">{{ result_data.hardware_data.base_data.cpu_count }}</td>
                                    </tr>
                                    <tr>
                                        <td>CPU物理核数</td>
                                        <td colspan="4">{{ result_data.hardware_data.base_data.cpu_physical_count }}</td>
                                    </tr>
                                    <tr>
                                        <td>CPU型号</td>
                                        <td colspan="4">{{ result_data.hardware_data.base_data.cpu_model }}</td>
                                    </tr>
                                    <!-- 网卡信息开始 -->
                                    <tr>
                                        <th colspan="5" class="title f14 th"><span class="padding-l-8">网卡信息</span></th>
                                    </tr>
                                    <tr>
                                        <td>名称</td>
                                        <td>MAC地址</td>
                                        <td>IP地址</td>
                                        <td>掩码</td>
                                        <td>UP</td>
                                    </tr>
                                    {% for i in result_data.hardware_data.nic_data %}
                                    <tr>
                                        <td>{{ i.name }}</td>
                                        <td>{{ i.hwaddr }}</td>
                                        <td>{{ i.ipaddrs }}</td>
                                        <td>{{ i.netmask }}</td>
                                        <td>{{ i.up }}</td>
                                    </tr>
                                    {% endfor %}

                                    <!-- 网卡信息结束 -->

                                    <!-- 硬盘信息开始 -->
                                    <tr>
                                        <th colspan="5" class="title f14" style="border-left:2px solid #0488cd;">
                                            <span class="padding-l-8">硬盘信息</span>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td>插槽</td>
                                        <td>容量</td>
                                        <td>接口类型</td>
                                        <td colspan="2">型号</td>
                                    </tr>

                                    {% for i in result_data.hardware_data.disk_data %}
                                    <tr>
                                        <td>{{ i.slot }}</td>
                                        <td>{{ i.capacity }}</td>
                                        <td>{{ i.pd_type }}</td>
                                        <td colspan="2">{{ i.model }}</td>

                                    </tr>
                                    {% endfor %}

                                    <!-- 硬盘信息结束 -->

                                    <!-- 内存信息开始 -->
                                    <tr>
                                        <th colspan="5" class="title f14" style="border-left:2px solid #0488cd;">
                                            <span class="padding-l-8">内存信息</span>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td>插槽</td>
                                        <td>容量</td>
                                        <td>频率</td>
                                        <td colspan="2">型号</td>
                                    </tr>

                                    {% for i in result_data.hardware_data.memory_data %}
                                    <tr>
                                        <td>{{ i.slot }}</td>
                                        <td>{{ i.capacity }}</td>
                                        <td>{{ i.speed }}</td>
                                        <td colspan="2">{{ i.model }}</td>
                                    </tr>
                                    {% endfor %}

                                    <!-- 内存信息结束 -->
                                </tbody>
                            </table>
                        </div>

                    </div>
                    <div role="tabpanel" class="tab-pane" id="log">

                        <div class="clearfix handle_log">
                            <div class="left clearfix" style="border-left:2px dashed #ddd;width:70%; margin-left: 220px;">

                                {% for i in  result_data.log_data %}
                                <div style="position:relative;">
                                    <div class="time">{{ i.create_at | date:"Y-m-d H:i:s" }}</div>
                                    <div class="record-arrow"></div>
                                    <div class="record">
                                        {{ i.content }}
                                        <div class="auther">
                                            <span><i class="fa fa-user"></i></span>

                                            <span>{{ i.creator }}</span>

                                        </div>
                                    </div>
                                </div>
                                {% endfor %}
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>

    </div>
{% endblock %}

{% block js %}
           <script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
{#           <script type="text/javascript" src="/static/plugins/bootstrap/js/bootstrap.js"></script>#}



 {% endblock %}
